<?php
    include_once("../action/checkAuthenticationAction.php");
    include_once("../util/authUtil.php");
    include_once("../service/categoryService.php");
    include_once("../service/productService.php");
    include_once("../service/receiptService.php");
    include_once("../service/newsletterService.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>Dashboard</title>
	<?php include("import-css.php");?>	
</head>
<body>
	<?php include("header.php");?>
	
	<div class="container-fluid">
		<div class="row-fluid">
			
			<?php include("menu.php");?>
			
			<div id="content" class="span10">
                <div class="box-header well" data-original-title>
                    Thống kê hệ thống
                </div>
                <div class="box-content">
                    <table class="table table-striped table-bordered bootstrap-datatable datatable">
    						  <thead>
    							  <tr>
    								  <th>Thống kê</th>
    								  <th>Chi tiết</th>
    							  </tr>
    						  </thead>   
    						  <tbody>
                              <?php
                                $qtyCategory = getTotalCategory();
                                $qtyProduct = getTotalProduct();
                                $qtyActiveProduct = getActiveTotalProduct();
                                $qtyDiscountedProduct = getDiscountProduct();
                                $newsletter = getTotalSubscriber();
                                $receipt = getQtyReceipt();
                              ?>
                                <tr>
                                    <td>
                                    Tổng số loại sản phẩm
                                    </td>
                                    <td>
                                    <?php echo $qtyCategory; ?> loại
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    Tổng số mặt hàng
                                    </td>
                                    <td>
                                    <?php echo $qtyProduct; ?> mặt hàng (<?php echo $qtyActiveProduct; ?> mặt hàng đang kinh doanh) 
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    Tổng số mặt hàng khuyến mãi
                                    </td>
                                    <td>
                                    <?php echo $qtyDiscountedProduct; ?> mặt hàng 
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    Tổng số đơn hàng
                                    </td>
                                    <td>
                                    <?php echo $receipt; ?> đơn hàng 
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    Tổng số người đăng kí nhận tin tức
                                    </td>
                                    <td>
                                    <?php echo $newsletter; ?> khách hàng 
                                    </td>
                                </tr>
                              </tbody>
                    </table>
                </div>
			</div><!--/#content.span10-->
		</div><!--/fluid-row-->
				
		<?php include("footer.php");?>
		
	</div><!--/.fluid-container-->

	<?php include("import-js.php");?>	
</body>
</html>